Skip to content

Ticket #3159: Update color names#5001

Open
egmontkob wants to merge 3 commits intoMidnightCommander:masterfrom
egmontkob:3159-color-names
Open

Ticket #3159: Update color names#5001
egmontkob wants to merge 3 commits intoMidnightCommander:masterfrom
egmontkob:3159-color-names

Conversation

@egmontkob
Copy link
Contributor

Proposed changes

Change the color names as proposed in #3159 (comment).

Checklist

  • I have referenced the issue(s) resolved by this PR (if any)
  • I have signed-off my contribution with git commit --amend -s
  • Lint and unit tests pass locally with my changes (make indent && make check)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

While working on this change, I noticed that mc used the same color names as slang (it does take strings like "brown", "yellow" etc. in its API). I assume that's where mc's terminology originated from, it just simply decided to pass the strings unchanged to slang and document them.

Luckily, slang has also accepted since the ancient days (199x) keywords like "color0", "color1" etc. instead. So I'm switching to using them, rather than having two confusingly slightly different namings, like mapping mc's "brightyellow" to slang's "yellow" and such.


Most of the big change was prepared using this trivial script

#!/bin/bash

sed -e 's/\bwhite\b/brightwhite/g' \
    -e 's/\blightgray\b/white/g' \
    -e 's/\bgray\b/brightblack/g' \
    -e 's/\byellow\b/brightyellow/g' \
    -e 's/\bbrown\b/yellow/g' \
    -i "$@"

but then I did a thorough review and had to revert here and there; most notably in css.syntax so that we don't change the color-related css keywords.


Although I've prepared this change now and I'd appreciate a review, I think I'll hold it back until we come up with more backwards incompatible changes, like the revamp of the skin file's keywords. I don't want this one to be the first (and if for whatever reason the work stop then the only) backwards incompatible skin change.

Don't pass color names like "black", "red" to slang, instead pass
index-based identifiers like "color0", "color1" etc.

This is in preparation for the next commit in which mc will diverge
from slang's color names.

Signed-off-by: Egmont Koblinger <egmont@gmail.com>
@github-actions github-actions bot added needs triage Needs triage by maintainers prio: medium Has the potential to affect progress labels Feb 6, 2026
@github-actions github-actions bot added this to the Future Releases milestone Feb 6, 2026
@egmontkob egmontkob added area: skin Theming support and skin files and removed needs triage Needs triage by maintainers labels Feb 6, 2026
@egmontkob egmontkob modified the milestones: Future Releases, 4.9.0 Feb 6, 2026
@egmontkob egmontkob requested review from mc-worker and zyv February 6, 2026 12:13
Copy link
Member

@zyv zyv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simply scrolled through the changes trying to see if anything stands out that shouldn't have been replaced, but nothing jumped out.

For the legacy 16 colors, switch to a more standard naming that
better reflects their internal 8+8 logic.

Old names marked with a '-', new names marked with a '+' here:

   black      -gray           ->   black    +brightblack
   red         brightred      ->   red       brightred
   green       brightgreen    ->   green     brightgreen
  -brown      -yellow         ->  +yellow   +brightyellow
   blue        brightblue     ->   blue      brightblue
   magenta     brightmagenta  ->   magenta   brightmagenta
   cyan        brightcyan     ->   cyan      brightcyan
  -lightgray  -white          ->  +white    +brightwhite

This is a backwards incompatible change. Skin and syntax highlight files
need to be updated.

Signed-off-by: Egmont Koblinger <egmont@gmail.com>
We are breaking skin compatibility anyway, so there's no point carrying it.

Signed-off-by: Egmont Koblinger <egmont@gmail.com>
@egmontkob
Copy link
Contributor Author

I forgot the obvious last step: a recursive search for the old names. I forgot to update one file, addressed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: skin Theming support and skin files prio: medium Has the potential to affect progress

Development

Successfully merging this pull request may close these issues.

2 participants